package com.spa.application.dto.member;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.spa.infrastructure.enums.dict.order.OrderOperStatusEnum;
import com.spa.infrastructure.enums.dict.order.OrderStatusEnum;
import lombok.Data;

import java.util.Date;
import java.util.List;

@Data
@JsonInclude
public class MemberOrderDetailDTO {

    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long id;

    private OrderStatusEnum status;

    private OrderOperStatusEnum operateStatus;

    private String orderCode;

    private String priceType;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date appointTime;

    private Date takeTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date departTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date arriveTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date startTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date cancelTime;

    private String cancelReason;

    private Integer travelPrice;

    private String travelDist;

    private String travelType;

    private String massagistName;

    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long massagistId;

    private String massagistWorkPhoto;

    private List<OrderExtDTO> orderExtList;

    private ServiceDTO serviceDTO;

    private Integer totalDuration;

    private Integer totalPrice;

    private Integer discount;

    private UserDTO userDTO;

    private boolean hasComments;

    private String remark;

    private Integer couponPrice;

    @Data
    @JsonInclude
    public static class UserDTO {

        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private Date appointTime;

        private String name;

        private String phone;

        private String address;

    }

    @Data
    @JsonInclude
    public static class OrderExtDTO {

        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private Date startTime;

        private Integer totalDuration;

        private Integer totalPrice;

        private String serviceName;

        private Integer duration;

        private Integer orderCount;

        private Integer price;

        private Integer discountPrice;

        private String cover;
    }

    @Data
    @JsonInclude
    public static class ServiceDTO {

        private String serviceName;

        private Integer duration;

        private Integer orderCount;

        private Integer price;

        private Integer discountPrice;

        private String cover;

        private String recommendations;
    }
}
